﻿using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

namespace Studio
{
	// Token: 0x020004A8 RID: 1192
	public static class ObjectInfoAssist
	{
		// Token: 0x06001DCE RID: 7630 RVA: 0x000BC958 File Offset: 0x000BAB58
		public static void LoadChild(BinaryReader _reader, Version _version, List<ObjectInfo> _list, bool _import)
		{
			int num = _reader.ReadInt32();
			for (int i = 0; i < num; i++)
			{
				int num2 = _reader.ReadInt32();
				switch (num2)
				{
				case 0:
				{
					OICharInfo oicharInfo = new OICharInfo(null, _import ? Studio.GetNewIndex() : -1);
					oicharInfo.Load(_reader, _version, _import, true);
					_list.Add(oicharInfo);
					break;
				}
				case 1:
				{
					OIItemInfo oiitemInfo = new OIItemInfo(-1, _import ? Studio.GetNewIndex() : -1);
					oiitemInfo.Load(_reader, _version, _import, true);
					_list.Add(oiitemInfo);
					break;
				}
				case 2:
				{
					OILightInfo oilightInfo = new OILightInfo(-1, _import ? Studio.GetNewIndex() : -1);
					oilightInfo.Load(_reader, _version, _import, true);
					_list.Add(oilightInfo);
					break;
				}
				case 3:
				{
					OIFolderInfo oifolderInfo = new OIFolderInfo(_import ? Studio.GetNewIndex() : -1);
					oifolderInfo.Load(_reader, _version, _import, true);
					_list.Add(oifolderInfo);
					break;
				}
				default:
					GlobalData.Debug_LogWarning(string.Format("有奇怪的情报 : {0}", num2));
					break;
				}
			}
		}
	}
}
